package com.xgs.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xgs.common.utils.StringUtils;
import com.xgs.system.domain.Lane;
import com.xgs.system.mapper.LaneMapper;
import com.xgs.system.service.LaneService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author JerryLu
 * @date 2024/10/23 11:01
 * @description 收费站信息Service业务层处理
 */
@Service
public class LaneServiceImpl extends ServiceImpl<LaneMapper, Lane> implements LaneService {
    @Override
    public List<Lane> queryList(Lane lane) {
        QueryWrapper<Lane> queryWrapper = Wrappers.query();
        if (StringUtils.isNotEmpty(lane.getStationName())) {
            queryWrapper.like("station_name", lane.getStationName());
        }
        if (StringUtils.isNotEmpty(lane.getOrgId())) {
            queryWrapper.like("org_id", lane.getOrgId());
        }
        if (StringUtils.isNotEmpty(lane.getOrgName())) {
            queryWrapper.like("org_name", lane.getOrgName());
        }
        return this.list(queryWrapper);
    }
}
